package com.example.poemtest.entity;

import android.net.Uri;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 词帖的实体类
 * created by JHT on 2024/5/18
 */
public class PostInfoBean {
    private int code;
    private String msg;
    private List<PostInfoBean.PostInfo> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<PostInfoBean.PostInfo> getData() {
        return data;
    }

    public void setData(List<PostInfoBean.PostInfo> data) {
        this.data = data;
    }

    public static class PostInfo implements MultiItemEntity {
        private int postId;
        private String postAuthor;
        private String postContent;
        private Date postCreateTime;
        private Date postReviseTime;
        private String postVideoSrc;
        private int userId;
        private String postUserPhotoSrc;
        private int postType;
        private List<String> photos;
        private List<LikeInfo> likeInfos;
        private List<CommentInfo> commentInfos;
        private int isLike;

        public int getPostId() {
            return postId;
        }

        public void setPostId(int postId) {
            this.postId = postId;
        }

        public String getPostAuthor() {
            return postAuthor;
        }

        public void setPostAuthor(String postAuthor) {
            this.postAuthor = postAuthor;
        }

        public String getPostContent() {
            return postContent;
        }

        public void setPostContent(String postContent) {
            this.postContent = postContent;
        }

        public Date getPostCreateTime() {
            return postCreateTime;
        }

        public void setPostCreateTime(Date postCreateTime) {
            this.postCreateTime = postCreateTime;
        }

        public Date getPostReviseTime() {
            return postReviseTime;
        }

        public void setPostReviseTime(Date postReviseTime) {
            this.postReviseTime = postReviseTime;
        }

        public String getPostVideoSrc() {
            return postVideoSrc;
        }

        public void setPostVideoSrc(String postVideoSrc) {
            this.postVideoSrc = postVideoSrc;
        }

        public int getUserId() {
            return userId;
        }

        public void setUserId(int userId) {
            this.userId = userId;
        }

        public String getPostUserPhotoSrc() {
            return postUserPhotoSrc;
        }

        public void setPostUserPhotoSrc(String postUserPhotoSrc) {
            this.postUserPhotoSrc = postUserPhotoSrc;
        }

        public int getPostType() {
            return postType;
        }

        public void setPostType(int postType) {
            this.postType = postType;
        }

        public List<String> getPhotos() {
            return photos;
        }

        public List<Uri> getImageUriList() {
            List<Uri> imageUriList = new ArrayList<>();
            if (photos != null && photos.size() > 0) {
                for (String str : photos) {
                    imageUriList.add(Uri.parse(str));
                }
            }
            return imageUriList;
        }

        public void setPhotos(List<String> photos) {
            this.photos = photos;
        }

        public List<LikeInfo> getLikeInfos() {
            return likeInfos;
        }

        public void setLikeInfos(List<LikeInfo> likeInfos) {
            this.likeInfos = likeInfos;
        }

        public List<CommentInfo> getCommentInfos() {
            return commentInfos;
        }

        public void setCommentInfos(List<CommentInfo> commentInfos) {
            this.commentInfos = commentInfos;
        }

        public int getIsLike() {
            return isLike;
        }

        public void setIsLike(int isLike) {
            this.isLike = isLike;
        }

        @Override
        public String toString() {
            return "PostInfo{" +
                    "postId=" + postId +
                    ", postAuthor='" + postAuthor + '\'' +
                    ", postContent='" + postContent + '\'' +
                    ", postCreateTime=" + postCreateTime +
                    ", postReviseTime=" + postReviseTime +
                    ", postVideoSrc='" + postVideoSrc + '\'' +
                    ", userId=" + userId +
                    ", postUserPhotoSrc='" + postUserPhotoSrc + '\'' +
                    ", postType=" + postType +
                    ", photos=" + photos +
                    ", likeInfos=" + likeInfos +
                    ", commentInfos=" + commentInfos +
                    ", isLike=" + isLike +
                    '}';
        }

        @Override
        public int getItemType() {
            return postType;
        }
    }

}
